﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="ChangeContract.aspx.cs"
    Inherits="H2.NET.Web.Pages.SMD.ChangeContract" %>
<%@ Import Namespace="H2.NET.Common" %>
<%@ Import Namespace="H2.NET.Web.Pages.SMD.Service" %>

<%@ Register Src="../../Controls/DwzAssessment.ascx" TagName="DwzAssessment" TagPrefix="uc" %>
<%@ Register Src="../../Controls/DwzAssessmentList.ascx" TagName="DwzAssessmentList" TagPrefix="uc" %>
<%@ Register Src="../../Controls/AjaxUpload.ascx" TagName="ajaxUpload" TagPrefix="uc" %>
<%@ Register Src="uc_store_info.ascx" TagName="uc_store_info" TagPrefix="uc" %>
<%@ Register Src="uc_change_menu.ascx" TagName="uc_change_menu" TagPrefix="uc" %>
<%@ Register Src="uc_change_field.ascx" TagName="uc_change_field" TagPrefix="uc" %>
<%@ Register Src="uc_head.ascx" TagName="uc_head" TagPrefix="uc1" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE9" />
<head id="Head1" runat="server">
    <title>合同主数据变更</title>
    <link href="<%=Page.ResolveUrl("~/Resource/Css/Style.css")%>" type="text/css" rel="stylesheet" />
    <link href="<%=Page.ResolveUrl("~/Resource/jBox/Blue/jbox.css")%>" rel="stylesheet" type="text/css" />
    <link href="<%=Page.ResolveUrl("~/Resource/Css/validform.css")%>" rel="stylesheet" type="text/css" />
    <link href="<%=Page.ResolveUrl("~/Resource/qtip/jquery.qtip.min.css")%>" rel="stylesheet" type="text/css" />
    <script src="<%=Page.ResolveUrl("~/Resource/dwz/js/jquery-1.7.2.min.js")%>" type="text/javascript"></script>
    <script src="<%=Page.ResolveUrl("~/Resource/Js/Common.js")%>" type="text/javascript"></script>
    <script src="<%=Page.ResolveUrl("~/Resource/Js/jquery.money.js")%>" type="text/javascript"></script>
    <script src="<%=Page.ResolveUrl("~/Resource/jBox/jquery.jBox-2.3.min.js")%>" type="text/javascript"></script>
    <script src="<%=Page.ResolveUrl("~/Resource/jBox/jquery.jBox-zh-CN.js")%>" type="text/javascript"></script>
    <script src="<%=Page.ResolveUrl("~/Resource/Js/Validform_v5.3.2.js")%>" type="text/javascript"></script>
    <script src="<%=Page.ResolveUrl("~/Resource/My97DatePicker/WdatePicker.js")%>" type="text/javascript"></script>
    <script src="<%=Page.ResolveUrl("~/Resource/qtip/jquery.qtip.min.js")%>" type="text/javascript"></script>
    <style type="text/css">
        .qgqy {
            display: none;
        }
        .auto-style1 {
            height: 25px;
        }


        #DeviceCancelContractType {
        background-color:#f2eded;
        }
    </style>
    <script type="text/javascript">
        $(function () {
            var step = '<%=step%>';
            if (step == "Submit Data") {
                $(".DeviceContract").hide();
                $(".StoreContract").hide();
            }
            if (step == "Manager Approve") {
                $(".qgqy").each(function () {
                    $(this).show();
                });
            }
             <%if (OpenBusinessDate != "")
              {%>
            $("#tb_StoreContractBeginDate").qtip({
                content: "门店营业时间为：<%:OpenBusinessDate%>"
            });
            <%}%>

            /* 初始化控件提示 st */
            $.ajax({
                type: 'POST',
                url: '<%=Page.ResolveUrl("~/pages/smd/ajaxtools/handler.ashx?action=get_tips")%>',
                data: { pagename: 'transfer.aspx' },
                dataType: "json",
                cache: false,
                success: function (json) {
                    for (var o in json) {
                        var controlID = json[o].ControlID;
                        var content = json[o].Content;
                        $("#" + controlID).qtip({
                            content: content
                        });
                    }
                }
            });
            /* 初始化控件提示 ed */


            /* 初始化相关样式、表单验证提示 st */
            $('[datatype=\'*\']').after("<em class='required'>*</em>");
            $("#form1").Validform({
                tipSweep: true,
                tiptype: function (msg, o, cssctl) {
                    if (o.type == 3) {
                        $.jBox.tip(msg, 'info');
                    }
                }
            });
            /* 初始化相关样式、表单验证提示 ed */

            // 双击选择门店之后跳转的url
            $("#return_url").val('<%=Page.ResolveUrl("~/pages/smd/ChangeContract.aspx?TaskID=" + TaskAPI.TaskID)%>');


            //2016-11-28 当设备合同默认勾选，显示设备合同信息
            if ($("#cb_deviceContract").attr("checked") == "checked" || $("#cb_deviceContract").attr("checked") == true) {
                $(".DeviceContract").show();
            }

        });

        // 这个脚本是 ie6和ie7 通用的脚本
        function custom_close() {
            if (confirm("您确定要关闭本页吗？")) {
                window.opener = null;
                window.open('', '_self');
                window.close();
            }
            else { }
        }

    

        function doChooseHT(ht) {
            if ($(ht).attr("checked") == "checked") {
                $("#" + $(ht).attr("a") + "").show();
            } else {
                $("#" + $(ht).attr("a") + "").hide();
            }
        }

        /* 提交表单 st */
        function confirmSubmit() {
            var step = '<%=step%>';
            if (step == "Submit Data" || step == "Manager Approve") {
                if (window.confirm("请确认内容填写完整，否则请点暂存！")) {
                    $.jBox.tip('正在处理，请稍等...', 'loading');
                    return true;
                }
            } else {
                if (window.confirm("确认要提交吗？")) {
                    $.jBox.tip('正在处理，请稍等...', 'loading');
                    return true;
                }
            }
            return false;
        }
        /* 提交表单 ed */

        /* 暂存表单 st */
        function confirmSave() {
            $.jBox.tip('正在保存，请稍等...', 'loading');
            return true;
        }
        /* 暂存表单 ed */

        function showContract(obj, str) {
            if ($(obj).attr("checked") == "checked") {
                if (str == "1") {
                    $("#storeContract").show();
                }
                if (str == "2") {
                    $("#deviceContract").show();
                }
            } else {
                if (str == "1") {
                    $("#storeContract").hide();
                }
                if (str == "2") {
                    $("#deviceContract").hide();
                }
            }
        }

        /*
          合同性质改变
        */
        function onNatureChange(obj, type) {
            if (obj.value == "无法签署") {
                if (type == "store") {
                    $("#tr_StoreNoSign").show();
                    $("#tb_StoreNotSignReason").attr("datatype", "*").after("<em class='required'>*</em>");
                } else {
                    $("#tr_DeviceNoSign").show();
                    $("#tb_DeviceNotSignReason").attr("datatype", "*").after("<em class='required'>*</em>");
                    $(obj).parent().parent().next().children().eq(1).children().eq(0).removeAttr("datatype").find("~em").remove();
                    $(obj).parent().parent().next().css("display", "");
                    $(obj).parent().parent().next().children().eq(1).children().eq(1).attr("datatype", "*").after("<em class='required'>*</em>");
                }
            } else {
                if (type == "store") {
                    $("#tr_StoreNoSign").hide();
                    $("#tb_StoreNotSignReason").removeAttr("datatype").find("~em").remove();
                } else {
                    $("#tr_DeviceNoSign").hide();
                    $("#tb_DeviceNotSignReason").removeAttr("datatype").find("~em").remove();
                    $(obj).parent().parent().next().css("display", "none");
                    $(obj).parent().parent().next().children().eq(1).children().eq(1).removeAttr("datatype").find("~em").remove();
                }
            }
        }
        
        function onCancelNatureChange(obj, type) {
            if (obj.value == "无法签署") {
                if (type == "store") {
                    $("#tr_StoreCancelNoSign").show();
                    $("#tb_StoreCancelNotSignReason").attr("datatype", "*").after("<em class='required'>*</em>");
                } else {
                    $("#tr_DeviceCancelNoSign").show();
                    $("#tb_DeviceCancelNotSignReason").attr("datatype", "*").after("<em class='required'>*</em>");
                    $(obj).parent().parent().next().children().eq(1).children().eq(1).removeAttr("datatype").find("~em").remove();
                    $(obj).parent().parent().next().css("display", "");
                    $(obj).parent().parent().next().children().eq(1).children().eq(1).attr("datatype", "*").after("<em class='required'>*</em>");
                }
            } else {
                if (type == "store") {
                    $("#tr_StoreCancelNoSign").hide();
                    $("#tb_StoreCancelNotSignReason").removeAttr("datatype").find("~em").remove();
                } else {
                    $("#tr_DeviceCancelNoSign").hide();
                    $("#tb_DeviceCancelNotSignReason").removeAttr("datatype").find("~em").remove();
                    $(obj).parent().parent().next().css("display", "none");
                    $(obj).parent().parent().next().children().eq(1).children().eq(1).removeAttr("datatype").find("~em").remove();
                }
            }
        }

   

        function doShowContract(obj, type) {
            if ($(obj).attr("checked") == "checked") {
                if (type == "store") {
                    $(".StoreContract").show();
                } else if (type == "device") {
                    $(".DeviceContract").show();
                }
            } else if ($(obj).attr("checked") == null) {
                if (type == "store") {
                    $(".StoreContract").hide();
                } else if (type == "device") {
                    $(".DeviceContract").hide();
                }
            }
        }

        function changeDeviceContractType(obj) {
            if ($(obj).val() == "1306A") {
             //   $("#td_DeviceCancelContractType").html("合同终止及三方转移合同");
             $("#DeviceCancelContractType").val("合同终止及三方转移合同");
            } else if ($(obj).val() == "Contract-TT-1701A") {
              //  $("#td_DeviceCancelContractType").html("设备终止投放及三方转移协议");
              $("#DeviceCancelContractType").val("设备终止投放及三方转移协议");
            }
        }

       
    </script>
</head>
<body>
    <div class="flowpage">
        <form id="form1" runat="server">
            <!-- 标题 st -->
            <uc1:uc_head ID="uc_head1" runat="server" />
            <!-- 标题 ed -->
            <uc:uc_change_menu ID="uc_change_menu1" runat="server" />
            <table class="formTable">
                <!-- 门店基本信息 st -->
                <uc:uc_store_info ID="uc_store_info1" runat="server" />
                <uc:uc_store_info ID="uc_store_info2" runat="server" />
                <!-- 门店基本信息 ed -->
                <!-- 选择合同st -->
                <tbody>
                    <tr>
                        <th class="title" colspan="6">选择合同<font style="color:red">所有合同的默认提示信息请在提交时进行确认</font></th>
                    </tr>
          <%--          <tr id="chooseStoreTR" runat="server" visible="false">
                        <td colspan="6">
                            <span>门店合同 <asp:CheckBox ID="cb_storeContract" runat="server" onclick='doShowContract(this,"store")' /></span>
                            <span style="color:red">除新开和翻新外，均需签署(合同终止及三方转移协议)合同</span>
                        </td>
                    </tr>--%>
                    <tr id="chooseDeviceTR" runat="server">
                        <td colspan="6">
                            <span>设备合同 <asp:CheckBox ID="cb_deviceContract" runat="server" onclick='doShowContract(this,"device")'/></span>
                            <span style="color:red">当设备状态从使用变成其他（报废、转让、库存），均需要签署(设备终止投放及三方转移协议)合同</span>
                        </td>
                    </tr>
                </tbody>
                <!-- 选择合同ed -->
                <!-- 合同信息 st -->
                
                <%--门店合同终止信息Start--%>
                <tbody id="StoreCancelContract" class="StoreContract" runat="server" visible="false" >
                    <tr>
                        <td class="title" colspan="6">门店合同终止信息
                        </td>
                    </tr>
                    <tr>
                        <th style="width: 13%;">门店合同版本号：
                        </th>
                        <td style="width: 20%;">
                            1306A
                        </td>
                        <th style="width: 13%;">门店合同类型：
                        </th>
                        <td style="width: 20%;">
                            <asp:Literal ID="StoreCancelContractType" runat="server"></asp:Literal>
                        </td>
                        <th>合同起始日期：
                        </th>
                        <td>
                            <input type="text" runat="server" class="Wdate" onfocus="WdatePicker('yyyy-MM-dd')" id="StoreCancelContractBeginDate"  />
                            <asp:Literal ID="l_StoreCancelContractBeginDate" runat="server"></asp:Literal>
                        </td>
                    </tr>
                    <tr>
                        <th>合同性质：
                        </th>
                        <td>
                            <asp:DropDownList ID="ddl_StoreCancelNature" runat="server" onchange="onCancelNatureChange(this,'store')">
                            </asp:DropDownList>
                            <asp:Literal ID="l_StoreCancelNature" runat="server"></asp:Literal>
                        </td>
                        <th>合同归属：
                        </th>
                        <td>
                            <asp:DropDownList ID="ddl_StoreCancelAffiliation" runat="server">
                            </asp:DropDownList>
                            <asp:Literal ID="l_StoreCancelAffiliation" runat="server"></asp:Literal>
                        </td>
                        <th>寄出快递单号：
                        </th>
                        <td>
                            <asp:TextBox ID="ToStoreCancelEms" runat="server"></asp:TextBox>
                            <asp:Literal ID="l_ToStoreCancelEms" runat="server"></asp:Literal>
                        </td>
                    </tr>
                    <tr id="tr_StoreCancelNoSign" runat="server">
	                    <th>无法签署合同原因：
	                    </th>
	                    <td colspan="5">
	                        <font style="color:red">如果选择无法签署，请必须上传Frank、CSM、RSM的审批邮件</font>
		                    <asp:TextBox ID="tb_StoreCancelNotSignReason" runat="server" Style="width: 80%"></asp:TextBox>
		                    <asp:Label ID="l_StoreCancelNotSignReason" runat="server"></asp:Label>
	                    </td>
                    </tr>
                    <tr>
                        <th>甲方：
                        </th>
                        <td>
                            <asp:DropDownList ID="StoreCancelParty" runat="server">
                            </asp:DropDownList>
                            <asp:Literal ID="l_StoreCancelParty" runat="server"></asp:Literal>
                        </td>
                        <th>合同份数：
                        </th>
                        <td>
                            3
                            <input type="hidden" id="StoreCancelCopies" runat="server"  value="3" />
                        </td>
                        <th>存档号：
                        </th>
                        <td>
                            <input type="text" id='StoreCancelFileNO' runat="server"/>
                            <asp:Literal ID="l_StoreCancelFileNO" runat="server"></asp:Literal>
                        </td>
                    </tr>
                    <tr class="qgqy">
                        <th>快递日期：
                        </th>
                        <td>
                            <input type="text" id="StoreCancelExpressDate" class="Wdate" onfocus="WdatePicker()" runat="server" />
                            <asp:Literal ID="l_StoreCancelExpressDate" runat="server"></asp:Literal>
                        </td>
                        <th>EMS单号：
                        </th>
                        <td>
                            <input type="text" id="StoreCancelEms" runat="server"/>
                            <asp:Literal ID="l_StoreCancelEms" runat="server"></asp:Literal>
                        </td>
                        <th>递交财务：
                        </th>
                        <td>
                            <input type="checkbox"  runat="server" id="StoreCancelFinance" />
                        </td>
                    </tr>
                    <tr class="qgqy">
                        <th>合同归档号：
                        </th>
                        <td>
                            <input type="text" runat="server" id="StoreCancelArchive"/>
                            <asp:Literal ID="l_StoreCancelArchive" runat="server"></asp:Literal>
                        </td>
                        <th>区域收到：
                        </th>
                        <td colspan="3">
                            <input type="checkbox" runat="server" id="StoreCancelRegionReceive" />
                        </td>
                    </tr>
                    <tr>
                        <th>备注：
                        </th>
                        <td colspan="5">
                            <input type="text" runat="server" id="CancelRemark" style="width: 80%" />
                            <asp:Literal ID="l_CancelRemark" runat="server"></asp:Literal>
                        </td>
                    </tr>

                </tbody>
                <%--门店合同终止信息End--%>

                <%--门店合同信息Start--%>
                <tbody id="storeContract" class="StoreContract" runat="server" style="display: none" visible="false">
                    <tr>
                        <td class="title" colspan="6">门店合同信息
                        </td>
                    </tr>
                    <tr>
                        <th style="width: 13%;">门店合同版本号：
                        </th>
                        <td style="width: 20%;">
                            <asp:DropDownList ID="ddl_StoreContractSN" runat="server" onchange="onNatureChange(this,'store')">
                            </asp:DropDownList>
                            <asp:Literal ID="l_StoreContractSN" runat="server"></asp:Literal>
                        </td>
                        <th style="width: 13%;">门店合同类型：
                        </th>
                        <td style="width: 20%;">
                            <asp:DropDownList ID="ddl_StoreContractType" runat="server">
                            </asp:DropDownList>
                            <asp:Literal ID="l_StoreContractType" runat="server"></asp:Literal>
                        </td>
                        <th>合同起始日期：
                        </th>
                        <td>
                            <asp:TextBox ID="tb_StoreContractBeginDate" CssClass="Wdate" onclick="" onfocus="WdatePicker({maxDate:'%y-%M-%d'})"
                                runat="server"></asp:TextBox>
                            <asp:Literal ID="l_StoreContractBeginDate" runat="server"></asp:Literal>
                        </td>
                    </tr>

                    <tr style="display: none">
                        <th>签署合同及协议：
                        </th>
                        <td colspan="5">
                            <label>
                                <input type="checkbox" id="cb_HasAwardContract" onclick="doChooseHT(this)" a="mdjlht"
                                    runat="server" />
                                门店奖励合同
                            </label>
                            <label>
                                <input type="checkbox" id="cb_HasTransferContract" onclick="doChooseHT(this)" a="sfzyht"
                                    runat="server" />
                                三方转移合同
                            </label>
                            <label>
                                <input type="checkbox" id="cb_HasRenewContract" onclick="doChooseHT(this)" a="snysxq"
                                    runat="server" />
                                3年以上门店续签协议
                            </label>
                        </td>
                    </tr>
                    <tr id="mdjlht" style="display: none" runat="server">
                        <th>门店奖励合同：
                        </th>
                        <td colspan="5">
                            <table class="formTable">
                                <tr>
                                    <th>奖励合同起始日期：
                                    </th>
                                    <td>
                                        <asp:TextBox ID="tb_AwardContractBeginDate" CssClass="Wdate" onfocus="WdatePicker({maxDate:'%y-%M-%d'})"
                                            runat="server"></asp:TextBox>
                                        <asp:Literal ID="l_AwardContractBeginDate" runat="server"></asp:Literal>
                                    </td>
                                    <th>奖励合同到期日期：
                                    </th>
                                    <td>
                                        <asp:TextBox ID="tb_AwardContractEndDate" CssClass="Wdate" onfocus="WdatePicker({maxDate:'%y-%M-%d'})"
                                            runat="server"></asp:TextBox>
                                        <asp:Literal ID="l_AwardContractEndDate" runat="server"></asp:Literal>
                                    </td>
                                </tr>
                            </table>
                        </td>
                    </tr>
                    <tr id="sfzyht" style="display: none" runat="server">
                        <th>三方转移合同：
                        </th>
                    </tr>
                    <tr id="snysxq" style="display: none" runat="server">
                        <th>3年以上续签：
                        </th>
                        <td colspan="5">
                            <table class="formTable">
                                <tr>
                                    <th>续签合同起始日期：
                                    </th>
                                    <td>
                                        <asp:TextBox ID="tb_RenewContractBeginDate" CssClass="Wdate" onfocus="WdatePicker()"
                                            runat="server"></asp:TextBox>
                                        <asp:Literal ID="l_RenewContractBeginDate" runat="server"></asp:Literal>
                                    </td>
                                    <th>续签合同到期日期：
                                    </th>
                                    <td>
                                        <asp:TextBox ID="tb_RenewContractEndDate" CssClass="Wdate" onfocus="WdatePicker()"
                                            runat="server"></asp:TextBox>
                                        <asp:Literal ID="l_RenewContractEndDate" runat="server"></asp:Literal>
                                    </td>
                                </tr>
                            </table>
                        </td>
                    </tr>
                    <tr>
                        <th>合同性质：
                        </th>
                        <td>
                            <asp:DropDownList ID="StoreNature" runat="server" onchange="onNatureChange(this,'store')">
                            </asp:DropDownList>
                            <asp:Literal ID="l_StoreNature" runat="server"></asp:Literal>
                        </td>
                        <th>合同归属：
                        </th>
                        <td>
                            <asp:DropDownList ID="StoreAffiliation" runat="server">
                            </asp:DropDownList>
                            <asp:Literal ID="l_StoreAffiliation" runat="server"></asp:Literal>
                        </td>
                        <th>寄出快递单号：
                        </th>
                        <td>
                            <asp:TextBox ID="tb_ToStoreEms" runat="server"></asp:TextBox>
                            <asp:Label ID="l_ToStoreEms" runat="server"></asp:Label>
                        </td>
                    </tr>
                    <tr id="tr_StoreNoSign" runat="server">
                        <th>无法签署合同原因：
                        </th>
                        <td colspan="5">
                            <font style="color:red">如果选择无法签署，请必须上传Frank、CSM、RSM的审批邮件</font>
                            <asp:TextBox ID="tb_StoreNotSignReason" runat="server" Style="width: 80%"></asp:TextBox>
                            <asp:Label ID="l_StoreNotSignReason" runat="server"></asp:Label>
                        </td>
                    </tr>
                    <tr>
                        <th>甲方：
                        </th>
                        <td>
                             <asp:DropDownList ID="ddl_StoreParty" runat="server">
                            </asp:DropDownList>
                            <asp:Literal ID="l_StoreParty" runat="server"></asp:Literal>
                        </td>
                        <th>合同份数：
                        </th>
                        <td>
                            <asp:Literal ID="l_StoreCopies" runat="server"></asp:Literal>
                        </td>
                        <th>存档号：
                        </th>
                        <td>
                            <asp:TextBox ID="tb_StoreFileNO" runat="server"></asp:TextBox>
                            <asp:Literal ID="l_StoreFileNO" runat="server"></asp:Literal>
                        </td>
                    </tr>
                    <tr class="qgqy">
                        <th>快递日期：
                        </th>
                        <td>
                            <asp:TextBox ID="StoreExpressDate" CssClass="Wdate" onfocus="WdatePicker()" runat="server"></asp:TextBox>
                            <asp:Literal ID="l_StoreExpressDate" runat="server"></asp:Literal>
                        </td>
                        <th>EMS单号：
                        </th>
                        <td>
                            <asp:TextBox ID="StoreEms" runat="server"></asp:TextBox>
                            <asp:Literal ID="l_StoreEms" runat="server"></asp:Literal>
                        </td>
                        <th>递交财务：
                        </th>
                        <td>
                            <input type="checkbox" name='StoreFinance' runat="server" id="StoreFinance" />
                            <asp:Literal ID="l_StoreFinance" runat="server"></asp:Literal>
                        </td>
                    </tr>
                    <tr class="qgqy">
                        <th>合同归档号：
                        </th>
                        <td>
                            <asp:TextBox ID="StoreArchive" runat="server"></asp:TextBox>
                            <asp:Literal ID="l_StoreArchive" runat="server"></asp:Literal>
                        </td>
                        <th>区域收到：
                        </th>
                        <td colspan="3">
                            <asp:CheckBox ID="StoreRegionReceive" runat="server" onclick="" />
                            <label style="margin-right: 10px; color: Red">备注：勾选该项后，请提交收到快递后的确认邮件</label>
                        </td>
                    </tr>
                    <tr>
                        <th class="auto-style1">备注：
                        </th>
                        <td colspan="5" class="auto-style1">
                            <asp:TextBox ID="Remark" runat="server" Style="width: 80%"></asp:TextBox>
                            <asp:Literal ID="l_Remark" runat="server"></asp:Literal>
                        </td>
                    </tr>

                </tbody>
                <%--门店合同信息End--%>

                <!-- 设备终止合同st(因为设备终止只有在设备报废后才有，所以只有单个的情况下才会出现终止合同) -->
                <tbody id="oneDevieCancel" class="DeviceContract" runat="server">
                    <tr>
		            <td class="title" colspan="6">设备合同终止信息<font style="color:red"><%:oldDealerInfo %></font>
		            </td>
	                </tr>
	                <tr>
		                <th>设备合同版本号：
		                </th>
		                <td>
                            <asp:DropDownList ID="DeviceCancelContractSN" runat="server"  onchange="changeDeviceContractType(this)" >
                            </asp:DropDownList>
                            <asp:Literal ID="l_DevieCancelContractSN" runat="server"></asp:Literal>
		                </td>
		                <th>设备固定资产号：
		                </th>
		                <td colspan="3">
                             <asp:Literal ID="DeviceCancelFixAssetNo" runat="server"></asp:Literal>
		                  <%--  <asp:TextBox type="text" id="DeviceCancelFixAssetNo" runat="server" ReadOnly="true"></asp:TextBox>--%>

                            <asp:Literal ID="l_DeviceCancelFixAssetNo" runat="server"></asp:Literal>
		                </td>

	                </tr>
	                <tr>
		                <th>设备合同起始日期：
		                </th>
		                <td>
		                    <input type="text" runat="server" class="Wdate" onfocus="WdatePicker('yyyy-MM-dd')" id="DeviceCancelContractBeginDate"  />
                            <asp:Literal ID="l_DeviceCancelContractBeginDate" runat="server"></asp:Literal>
		                </td>
		                <th>设备合同类型：
		                </th>
		                <td colspan="3" id="td_DeviceCancelContractType">
                            <asp:TextBox ID="DeviceCancelContractType"  runat="server" Width="50%"  ReadOnly="true" CssClass="txtDeviceCancelContractType" onfocus="this.blur();"/>
		                </td>
	                </tr>
	                <tr>
		                <th>合同性质：
		                </th>
		                <td>
		                    <asp:DropDownList ID="s_DeviceCancelNature" runat="server" onchange="onCancelNatureChange(this,'device')">
                            </asp:DropDownList>
                            <asp:Literal ID="l_DeviceCancelNature" runat="server"></asp:Literal>
		                </td>
		                <th>合同归属：
		                </th>
		                <td>
		                    <asp:DropDownList ID="s_DeviceCancelAffiliation" runat="server">
                            </asp:DropDownList>
                            <asp:Literal ID="l_DeviceCancelAffiliation" runat="server"></asp:Literal>
		                </td>
		                <th>寄出快递单号：
		                </th>
		                <td>
		                    <input type="text" id="ToDeviceCancelEms" runat="server" />
                            <asp:Literal ID="l_ToDeviceCancelEms" runat="server"></asp:Literal>
		                </td>
	                </tr>
                    <tr id="tr_DeviceCancelNoSign" runat="server">
	                    <th>无法签署合同原因：
	                    </th>
	                    <td colspan="5">
	                        <font style="color:red">如果选择无法签署，请必须上传Frank、CSM、RSM的审批邮件</font>
		                    <asp:TextBox ID="tb_DeviceCancelNotSignReason" runat="server" Style="width: 80%"></asp:TextBox>
		                    <asp:Label ID="l_DeviceCancelNotSignReason" runat="server"></asp:Label>
	                    </td>
                    </tr>
	                <tr>
		                <th>甲方：
		                </th>
		                <td>
		                    <asp:DropDownList ID="DeviceCancelParty" runat="server">
                            </asp:DropDownList>
                            <asp:Literal ID="l_DeviceCancelParty" runat="server"></asp:Literal>
		                </td>
		                <th>合同份数：
		                </th>
		                <td>
		                    3
                            <input type="hidden" id="DeviceCopies" runat="server"  value="3" />
		                </td>
		                <th>存档号：
		                </th>
		                <td>
		                    <input type="text" id='DeviceCancelFileNO' runat="server"/>
                            <asp:Literal ID="l_DeviceCancelFileNO" runat="server"></asp:Literal>
		                </td>
	                </tr>
	                <tr class="qgqy">
		                <th>快递日期：
		                </th>
		                <td>
		                    <input type="text" id="DeviceCancelExpressDate" class="Wdate" onfocus="WdatePicker()" runat="server" />
                            <asp:Literal ID="l_DeviceCancelExpressDate" runat="server"></asp:Literal>
		                </td>
		                <th>EMS单号：
		                </th>
		                <td>
		                    <input type="text" id="DeviceCancelEms" runat="server"/>
                            <asp:Literal ID="l_DeviceCancelEms" runat="server"></asp:Literal>
		                </td>
		                <th>递交财务：
		                </th>
		                <td>
		                    <input type="checkbox"  runat="server" id="DeviceCancelFinance" />
		                </td>
	                </tr>
	                <tr class="qgqy">
		                <th>合同归档号：
		                </th>
		                <td>
		                    <input type="text" runat="server" id="DeviceCancelArchive"/>
                            <asp:Literal ID="l_DeviceCancelArchive" runat="server"></asp:Literal>
		                </td>
		                <th>区域收到：
		                </th>
		                <td colspan='3'>
		                    <input type="checkbox" runat="server" id="DeviceCancelRegionReceive" />
		                </td>
	                </tr>
	                <tr>
		                <th>备注：
		                </th>
		                <td colspan="5">
		                    <input type="text" runat="server" id="DeviceCancelRemark" style="width: 80%" />
                            <asp:Literal ID="l_DeviceCancelRemark" runat="server"></asp:Literal>
		                </td>
	                </tr>
                </tbody>
                <!-- 设备终止合同ed -->

                <tbody id="tb_Transfer" class="DeviceContract" runat="server">
                    <tr style="display: none">
                        <th>转出门店编号：
                        </th>
                        <td>
                            <asp:TextBox ID="tb_TransferFromStoreSN" runat="server"></asp:TextBox>
                            <asp:Literal ID="l_TransferFromStoreSN" runat="server"></asp:Literal>
                        </td>
                        <th>转出门店名称：
                        </th>
                        <td>
                            <asp:TextBox ID="tb_TransferToStoreSN" runat="server"></asp:TextBox>
                            <asp:Literal ID="l_TransferToStoreSN" runat="server"></asp:Literal>
                        </td>
                        <th>三方转移合同签订：
                        </th>
                        <td>
                            <asp:TextBox ID="tb_TransferContractDate" CssClass="Wdate" onfocus="WdatePicker()" runat="server"></asp:TextBox>
                            <asp:Literal ID="l_TransferContractDate" runat="server"></asp:Literal>
                        </td>
                    </tr>
                    <tr>
                        <th>乙方客户帐号：
                        </th>
                        <td colspan="3">
                            <asp:TextBox ID="tb_PartyACustomer" runat="server" Style="width: 300px;"></asp:TextBox>
                            <asp:Literal ID="l_PartyACustomer" runat="server"></asp:Literal>
                        </td>
                        <th>罚款金额：
                        </th>
                        <td>
                            <asp:TextBox ID="tb_FineAmount" runat="server" CssClass="ci"></asp:TextBox>
                            <asp:Literal ID="l_FineAmount" runat="server"></asp:Literal>
                        </td>

                    </tr>
                    <tr>
                        <th>丙方客户帐号：
                        </th>
                        <td colspan="3">
                            <asp:TextBox ID="tb_PartyBCustomer" runat="server" Style="width: 300px;"></asp:TextBox>
                            <asp:Literal ID="l_PartyBCustomer" runat="server"></asp:Literal>
                        </td>
                        <th>过户金额：
                        </th>
                        <td>
                            <asp:TextBox ID="tb_TransferAmount" runat="server" CssClass="ci"></asp:TextBox>
                            <asp:Literal ID="l_TransferAmount" runat="server"></asp:Literal>
                        </td>
                    </tr>
                </tbody>
                <asp:Repeater ID="rpt_deviceContract" runat="server" OnItemDataBound="rpt_deviceContract_ItemDataBound">
                    <ItemTemplate>
                        <%--<tbody id="tb_DeviceCancel" runat="server" class="DeviceContract">
	                        <tr>
		                        <td class="title" colspan="6">设备合同终止信息(<%#Eval("DeviceFixAssetNo") %>)
		                        </td>
	                        </tr>
	                        <tr>
		                        <th>设备合同版本号：
		                        </th>
		                        <td>1401A
	                                <input type="hidden" id="DeviceCancelContractSN" runat="server" value="1401A" />
			                        <input type="hidden" id="DeviceCancelID" runat="server" />
		                        </td>
		                        <th>设备固定资产号：
		                        </th>
		                        <td colspan="3">
			                        <asp:Literal ID="l_DeviceCancelFixAssetNo" runat="server" ></asp:Literal>
		                        </td>

	                        </tr>
	                        <tr>
		                        <th>设备合同起始日期：
		                        </th>
		                        <td>
			                        <asp:Literal ID="l_DeviceCancelContractBeginDate" runat="server" ></asp:Literal>
		                        </td>
		                        <th>设备合同类型：
		                        </th>
		                        <td colspan="3">
			                        <asp:Literal ID="l_DeviceCancelContractType" runat="server" ></asp:Literal>
		                        </td>
	                        </tr>
	                        <tr>
		                        <th>合同性质：
		                        </th>
		                        <td>
			                        <asp:Literal ID="l_DeviceCancelNature" runat="server"></asp:Literal>
		                        </td>
		                        <th>合同归属：
		                        </th>
		                        <td>
			                        <asp:Literal ID="l_DeviceCancelAffiliation" runat="server" ></asp:Literal>
		                        </td>
		                        <th>寄出快递单号：
		                        </th>
		                        <td>
			                        <asp:Literal ID="l_toDeviceCancelEMS" runat="server" ></asp:Literal>
		                        </td>
	                        </tr>
	                        <tr id="tr_DeviceCancelNoSign" runat="server">
		                        <th>无法签署合同原因：
		                        </th>
		                        <td colspan="5">
			                        <asp:Literal ID="l_DeviceCancelNotSignReason" runat="server" ></asp:Literal>
		                        </td>
	                        </tr>
	                        <tr>
		                        <th>甲方：
		                        </th>
		                        <td>阿克苏诺贝尔太古漆油（上海）有限公司
                        <input type="hidden" id="DeviceCancelParty" runat="server" name='DeviceCancelParty_<%#Eval("DeviceID") %>' value='阿克苏诺贝尔太古漆油（上海）有限公司' />
		                        </td>
		                        <th>合同份数：
		                        </th>
		                        <td>3
                        <input type="hidden" id="DeviceCancelCopies" runat="server" name='DeviceCancelCopies_<%#Eval("DeviceID") %>' value="3" />
		                        </td>
		                        <th>存档号：
		                        </th>
		                        <td>
			                        <asp:Literal ID="l_DeviceCancelFileNO" runat="server" ></asp:Literal>
		                        </td>
	                        </tr>
	                        <tr class="qgqy">
		                        <th>快递日期：
		                        </th>
		                        <td>
			                        <asp:Literal ID="l_DeviceCancelExpressDate" runat="server" ></asp:Literal>
		                        </td>
		                        <th>EMS单号：
		                        </th>
		                        <td>
			                        <asp:Literal ID="l_DeviceCancelEms" runat="server" ></asp:Literal>
		                        </td>
		                        <th>递交财务：
		                        </th>
		                        <td>
			                        <asp:Literal ID="l_DeviceCancelFinance" runat="server" >
			                        </asp:Literal>
		                        </td>
	                        </tr>
	                        <tr class="qgqy">
		                        <th>合同归档号：
		                        </th>
		                        <td>
			                        <asp:Literal ID="l_DeviceCancelArchive" runat="server" ></asp:Literal>
		                        </td>
		                        <th>区域收到：
		                        </th>
		                        <td colspan='3'>
			                        <asp:Literal ID="l_DeviceCancelRegionReceive" runat="server" ></asp:Literal>
		                        </td>
	                        </tr>
	                        <tr>
		                        <th>备注：
		                        </th>
		                        <td colspan="5">
			                        <asp:Literal ID="l_DeviceCancelRemark" runat="server" ></asp:Literal>
		                        </td>
	                        </tr>
                        </tbody>--%>
                        <tbody class="DeviceContract">
                            <tr>
                                <td class="title" colspan="6">设备合同信息(<%#Eval("DeviceFixAssetNo") %>)<font style="color:red"><%:newDealerInfo %></font></td>
                            </tr>
                            <tr>
                                <th>设备合同版本号：
                                </th>
                                <td>
                                    <input runat="server" type="hidden" id="h_DeviceContractSN" value='<%#Eval("DeviceContractSN") %>' />
                                    <select runat="server" id="d_DeviceContractSN" name='DeviceContractSN_<%#Eval("DeviceID") %>'></select>
                                    <input type="hidden" id="DeviceID" runat="server" value='<%#Eval("DeviceID") %>' />
                                    <asp:Literal ID="l_DeviceContractSN" runat="server" Text='<%#Eval("DeviceContractSN") ?? ""%>'></asp:Literal>
                                </td>
                                <th>设备固定资产号：
                                </th>
                                <td colspan="3">
                                    <input type="text" runat="server" id="DeviceFixAssetNo" name='DeviceFixAssetNo_<%#Eval("DeviceID") %>' value='<%#Eval("DeviceFixAssetNo")%>' />
                                    <asp:Literal ID="l_DeviceFixAssetNo" runat="server" Text='<%#Eval("DeviceFixAssetNo") ?? ""%>'></asp:Literal>
                                </td>

                            </tr>
                            <tr>
                                <th>设备合同起始日期：
                                </th>
                                <td>
                                    <input type="text" runat="server" class="Wdate" onfocus="WdatePicker('yyyy-MM-dd')" id="DeviceContractBeginDate" name='DeviceContractBeginDate_<%#Eval("DeviceID") %>' value='<%# FormatDateTime(Eval("DeviceContractBeginDate"), "yyyy-MM-dd")%>' />
                                    <asp:Literal ID="l_DeviceContractBeginDate" runat="server" Text='<%# FormatDateTime(Eval("DeviceContractBeginDate"), "yyyy-MM")%>'></asp:Literal>
                                </td>
                                <th>设备合同类型：
                                </th>
                                <td colspan="3">
                                    <input runat="server" type="hidden" id="h_DeviceContractType" value='<%#Eval("DeviceContractType") %>' />
                                    <select runat="server" id="d_DeviceContractType" name='DeviceContractType_<%#Eval("DeviceID") %>'></select>
                                    <asp:Literal ID="l_DeviceContractType" runat="server" Text='<%#Eval("DeviceContractType") %>'></asp:Literal>
                                </td>
                            </tr>
                            <tr>
                                <th>合同性质：
                                </th>
                                <td>
                                    <input type="hidden" runat="server" id="h_DeviceNature" value='<%#Eval("DeviceNature") %>' />
                                    <select runat="server" id="d_DeviceNature" onchange="onNatureChange(this,'device')" name='DeviceNature_<%#Eval("DeviceID") %>'></select>
                                    <asp:Literal ID="l_DeviceNature" runat="server" Text='<%#Eval("DeviceNature") %>'></asp:Literal>
                                </td>
                                <th>合同归属：
                                </th>
                                <td>
                                    <input type="hidden" runat="server" id="h_DeviceAffiliation" value='<%#Eval("DeviceAffiliation") %>' />
                                    <select runat="server" id="d_DeviceAffiliation" name='DeviceAffiliation_<%#Eval("DeviceID") %>'></select>
                                    <asp:Literal ID="l_DeviceAffiliation" runat="server" Text='<%#Eval("DeviceAffiliation") %>'></asp:Literal>
                                </td>
                                <th>寄出快递单号：
                                </th>
                                <td>
                                    <input type="text" id="ToDeviceEMS" runat="server" name='ToDeviceEMS_<%#Eval("DeviceID") %>' value='<%#Eval("ToDeviceEms") %>' />
                                    <asp:Literal ID="l_toDeviceEMS" runat="server" Text='<%#Eval("ToDeviceEms") %>'></asp:Literal>
                                </td>
                            </tr>
                            <tr id="tr_DeviceNoSign" runat="server">
                                <th>无法签署合同原因：
                                </th>
                                <td colspan="5">
                                    <font style="color:red">如果选择无法签署，请必须上传Frank、CSM、RSM的审批邮件</font>
                                    <input type="text" id="tb_DeviceNotSignReason" name="DeviceNotSignReason" runat="server" style="width: 80%" value='<%#Eval("DeviceNotSignReason") %>' />
                                    <asp:Literal ID="l_DeviceNotSignReason" runat="server" Text='<%#Eval("DeviceNotSignReason") %>'></asp:Literal>
                                </td>
                            </tr>
                            <tr>
                                <th>甲方：
                                </th>
                                <td>
                                    <input type="hidden" runat="server" id="h_DeviceParty" value='<%#Eval("DeviceParty") %>' />
                                    <select runat="server" id="d_DeviceParty" name='DeviceParty_<%#Eval("DeviceID") %>'></select>
                                    <asp:Literal ID="l_DeviceParty" runat="server" Text='<%#Eval("DeviceParty") %>'></asp:Literal>
                                </td>
                                <th>合同份数：
                                </th>
                                <td>3
                        <input type="hidden" id="DeviceCopies" runat="server" name='DeviceCopies_<%#Eval("DeviceID") %>' value="3" />
                                </td>
                                <th>存档号：
                                </th>
                                <td>
                                    <input type="text" id='DeviceFileNO' runat="server" name='DeviceFileNO_<%#Eval("DeviceID") %>' value='<%#Eval("DeviceFileNO") %>' />
                                    <asp:Literal ID="l_DeviceFileNO" runat="server" Text='<%#Eval("DeviceFileNO") %>'></asp:Literal>
                                </td>
                            </tr>
                            <tr class="qgqy">
                                <th>快递日期：
                                </th>
                                <td>
                                    <input type="text" id="DeviceExpressDate" class="Wdate" onfocus="WdatePicker()" runat="server" name='DeviceExpressDate_<%#Eval("DeviceID") %>' value='<%#FormatDateTime(Eval("DeviceExpressDate"),"yyyy-MM-dd") %>' />
                                    <asp:Literal ID="l_DeviceExpressDate" runat="server" Text='<%#FormatDateTime(Eval("DeviceExpressDate"),"yyyy-MM") %>'></asp:Literal>
                                </td>
                                <th>EMS单号：
                                </th>
                                <td>
                                    <input type="text" id="DeviceEms" runat="server" name='DeviceEms_<%#Eval("DeviceID") %>' value='<%#Eval("DeviceEms") %>' />
                                    <asp:Literal ID="l_DeviceEms" runat="server" Text='<%#Eval("DeviceEms") %>'></asp:Literal>
                                </td>
                                <th>递交财务：
                                </th>
                                <td>
                                    <input type="hidden" id="h_DeviceFinance" runat="server" value='<%#Eval("DeviceFinance")%>' />
                                    <input type="checkbox" name='DeviceFinance_<%#Eval("DeviceID") %>' runat="server" id="DeviceFinance" />
                                    <asp:Literal ID="l_DeviceFinance" runat="server" Text='<%#Eval("DeviceFinance")==null?"":Eval("DeviceFinance").Equals("True")?"是":"否" %>'>
                                    </asp:Literal>
                                </td>
                            </tr>
                            <tr class="qgqy">
                                <th>合同归档号：
                                </th>
                                <td>
                                    <input type="text" name='DeviecArcive_<%#Eval("DeviceID") %>' runat="server" id="DeviceArchive" value='<%#Eval("DeviceArchive") %>' />
                                    <asp:Literal ID="l_DeviceArchive" runat="server" Text='<%#Eval("DeviceArchive") %>'></asp:Literal>
                                </td>
                                <th>区域收到：
                                </th>
                                <td colspan='3'>
                                    <input type="hidden" id="h_DeviceRegionReceive" runat="server" value='<%#Eval("DeviceRegionReceive")%>' />
                                    <input type="checkbox" name='DeviceRegionReceive_<%#Eval("DeviceID") %>' runat="server" id="DeviceRegionReceive" />
                                    <asp:Literal ID="l_DeviceRegionReceive" runat="server" Text='<%#Eval("DeviceRegionReceive") == null?"":Eval("DeviceRegionReceive").Equals("True")?"是":"否" %>'></asp:Literal>
                                    <label style="margin-right: 10px; color: Red">备注：勾选该项后，请提交收到快递后的确认邮件</label>
                                </td>
                            </tr>
                            <tr>
                                <th>备注：
                                </th>
                                <td colspan="5">
                                    <input type="text" name='DeviceRemark_<%#Eval("DeviceID") %>' runat="server" id="DeviceRemark" value='<%#Eval("DeviceRemark") %>' style="width: 80%" />
                                    <asp:Literal ID="l_DeviceRemark" runat="server" Text='<%#Eval("DeviceRemark") %>'></asp:Literal>
                                </td>
                            </tr>
                        </tbody>
                    </ItemTemplate>
                </asp:Repeater>
                
                
                <tbody id="FileUpload" runat="server" visible="true">
                    <tr>
                        <th colspan="6" class="title">附件上传</th>
                    </tr>
                    <tr>
                        <th>相关附件：
                        </th>
                        <td colspan="5">
                            <uc:ajaxUpload ID="AjaxUpload1" runat="server" />
                            <asp:Literal ID="Literal1" runat="server"></asp:Literal>
                            <font style="color:red">如果选了无法签署，请确保上传了相应的附件。</font>
                        </td>
                    </tr>
                </tbody>
                <!-- 合同信息 ed -->
                <!-- 字段变更列表 st -->
                <tbody id="changelogs" runat="server" visible="false">
                    <tr>
                        <th>字段变更列表：
                        </th>
                        <td colspan="5">
                            <uc:uc_change_field ID="uc_change_field1" runat="server" />
                        </td>
                    </tr>
                </tbody>
                <!-- 字段变更列表 ed -->
                <!-- 审批列表 st -->
                <tbody id="assessment" runat="server" visible="false">
                    <tr>
                        <td class="title" colspan="6">审批列表
                        </td>
                    </tr>
                    <tr>
                        <td colspan="6">
                            <uc:DwzAssessmentList ID="DwzAssessmentList1" runat="server" />
                        </td>
                    </tr>

                </tbody>
                <!-- 相关附件 ed -->

                <!-- 审批意见 st -->
                <tbody>
                    <uc:DwzAssessment ID="DwzAssessment1" runat="server" />
                </tbody>
                <!-- 审批意见 ed -->
            </table>
            <%  if (H2.NET.Common.AksRequest.GetString("showbtn") != "0")
                { %>
            <div style="margin: 5px; padding-bottom: 10px; text-align: center;">
                <asp:Button ID="btn_submit" runat="server" CssClass="u-btn" Text="提交(Submit)" OnClick="btn_submit_Click" OnClientClick="return confirmSubmit();" />
                <asp:Button ID="btn_save" runat="server" CssClass="u-btn" Text="暂存(Save)" OnClick="btn_Save_Click" OnClientClick="return confirmSave();" />
                <input type="button" class="u-btn u-btn-c4" value="关闭(Close)" onclick="custom_close()" />
                <asp:HyperLink ID="hl_ExportPdf" runat="server" Visible="false" Target="_blank" CssClass="u-btn u-btn-c3" Style="height: 28px; line-height: 28px; display: inline-block;">生成(PDF)</asp:HyperLink>
                <asp:Button ID="btn_print" runat="server" CssClass="u-btn u-btn-c2" Text="打印(Print)" OnClientClick="window.print()" Visible="false" />
            </div>
            <%  } %>
        </form>
    </div>
</body>
</html>
